Software Development
HTTP Requests in Java
HTTP Requests in Java: HTTP Requests with Java's HttpClient
HTTP Requests in Java: Sending Simple HTTP Requests

HTTP Requests in Java: HTTP Requests with Java's HttpClient

Course Number:
it_jphtredj_02_enus
Lesson Objectives

HTTP Requests in Java: HTTP Requests with Java's HttpClient

  • discover the key concepts covered in this course
  • use the HttpClient class to send a GET request and process the response that is returned
  • describe the different methods available to access the data and metadata in an HttpResponse instance
  • set an upper limit on the amount of time you can wait for a response to an HTTP request
  • recognize the steps involved in automatic redirects and how these can be detected and handled with HttpClient
  • send an asynchronous request using HttpClient and recognize how this differs from a synchronous request
  • develop a program to send multiple asynchronous HTTP GET requests and process their responses once you are ready
  • implement POST, PUT and DELETE request calls using HttpClient
  • summarize the key concepts covered in this course

Overview/Description
Examine basic and advanced operations possible when building HTTP requests with Java's HttpClient through this course. Explore how to send a basic GET request and process the response that is returned, configure your request with timeouts, and implement POST, PUT, and DELETE requests. Delve into the features of the HttpClient, such as the use of BodyHandlers to write a response body to a file, detecting and getting information about any URL redirects involved in processing your request, and sending requests asynchronously. Upon completing this course, you'll be able to work with various HTTP requests using Java's HttpClient.

Target

Prerequisites: none

HTTP Requests in Java: Sending Simple HTTP Requests

Course Number:
it_jphtredj_01_enus
Lesson Objectives

HTTP Requests in Java: Sending Simple HTTP Requests

  • discover the key concepts covered in this course
  • set up a Maven project to build the HTTP client application
  • use the HttpURLConnection to configure and send an HTTP GET request
  • recognize various fields available in the response returned for an HTTP GET request
  • transform the body of an HTTP response containing JSON data into a formatted JSON string
  • include query parameters when submitting an HTTP GET request by adding them to the URL
  • set up and send an HTTP POST request along with JSON data in the request body
  • send HTTP PUT and DELETE requests to modify or delete a resource at the server
  • describe the role of a HEAD request to obtain information about a resource
  • set an upper limit on the amount of time you can wait for an HTTP request
  • summarize the key concepts covered in this course

Overview/Description
The HttpURLConnection is the oldest implementation of an HTTP client in Java and is still widely used today due to its simplicity and the fact that it is very lightweight. Use this course to familiarize yourself with different forms of HTTP requests. Try your hand at constructing a basic GET request to retrieve data, submitting it to a remote server, and processing the response that is returned. You'll also examine the use of a POST request to submit data to create a resource at a server, a PUT request to update a resource, and a DELETE request to remove it. You'll also look into setting a timeout for requests that take too long to process. After finishing this course, you'll be able to identify various HTTP requests and how these can be formulated and communicated in a Java app using the HttpURLConnection class.

Target

Prerequisites: none

Close Chat Live